package com.xbongbong.saas.service;

import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.contractperformance.pojo.ContractPerformanceLogPojo;
import com.xbongbong.pro.contractperformance.pojo.dto.ContractPerformanceDeleteBatchDTO;
import com.xbongbong.pro.contractperformance.pojo.vo.ContractPerformanceDeleteBatchVO;

import java.util.List;

/**
 * 合同业绩分配
 * @author 吴峰
 * @version v1.0
 * @date 2019/2/27 21:26
 * @since v1.0
 */
public interface ContractPerformanceService {

    /**
     * 批量删除合同业绩分配
     * @author 吴峰
     * @date 2019/3/13 17:07
     * @param contractPerformanceDeleteBatchDTO
     * @return com.xbongbong.pro.contractproduct.pojo.vo.ContractPerformanceDeleteBatchVO
     * @throws XbbException 业务异常
     */
    ContractPerformanceDeleteBatchVO deleteBatch(ContractPerformanceDeleteBatchDTO contractPerformanceDeleteBatchDTO) throws XbbException;

    /**
     * 是否开启了业绩分配
     *
     * @param
     * @param corpid 公司id
     * @return 是否开启
     * @throws XbbException 异常
     */
    Boolean openDistribution(String corpid) throws XbbException;

    /**
     * 在新建、编辑时根据签订人改变业绩归属，若没有业绩分配创建一条当前签订人的100%的业绩分配，若签订人改变，当前签订人替换原签订人的业绩分配
     *
     * @param newPaasFormDataEntity 合同实体
     * @throws XbbException 异常
     */
    void changeContractPerformance(PaasFormDataEntity newPaasFormDataEntity, List<ContractPerformanceLogPojo> contractPerformanceLogList) throws XbbException;

    /**
     * 更新回滚es
     * @param idIn
     * @param corpid
     * @throws XbbException
     */
    void updateRollbackByContractId(List<Long> idIn, String corpid) throws XbbException;
}
